.toolbar {
  position: fixed;
  z-index: 99999;
  height: 40px;
  width: 100vw;
}

.toolbar > .toolbararea {
  /* see https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/
     and https://bugs.chromium.org/p/chromium/issues/detail?id=578799 */
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  grid-template-rows: 38px;
  overflow: hidden;
  -webkit-app-region: drag;
  background: -webkit-linear-gradient(top, #ebebeb, #d5d5d5);
  border-bottom: 1px solid #a6a6a6;
  transition: opacity 0.2s ease-out;
  opacity: 0;
  display: grid;
  grid-template-columns: 1fr auto minmax(max-content, 1fr);
  grid-column-gap: 5px;
  align-items: center;
}
.toolbar:hover > .toolbararea {
  transition: opacity 0.12s ease-in;
  opacity: 1;
}

/* Place an invisible block where the macOS .windowbuttons are going to be
 * to push the title text away on very small windows */
._macOS .toolbar > .toolbararea::before {
  display: block;
  width: 80px;
  content: ' ';
}

.toolbar .windowbuttons {
  position: fixed;
  top: 5px;
  left: 8px;
  display: none;
}
._macOS .windowbuttons {
  display: flex;
  margin-top: 7px;
}
._macOS .windowbuttons > div {
  -webkit-app-region: no-drag;
  cursor: default;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border-width: 1px;
  border-style: solid;
  border-radius: 50%;
  margin-top: 1px;
  margin-left: 5px;
  margin-right: 4px;
  line-height: 0;
}
._macOS .windowbuttons > div:nth-child(1) {
  background-color: rgb(255, 95, 87);
  border-color: rgb(226, 70, 63);
}
._macOS .windowbuttons > div:nth-child(2) {
  background-color: rgb(255, 189, 46);
  border-color: rgb(225, 161, 22);
}
._macOS .windowbuttons > div:nth-child(3) {
  background-color: rgb(40, 201, 64);
  border-color: rgb(18, 172, 40);
}
._macOS .windowbuttons img {
  display: none;
}
._macOS .windowbuttons:hover img {
  display: inline;
}

.toolbar img {
  -webkit-user-drag: none;
}

.toolbar .filename {
  color: #676767;
  grid-column-start: 2;
  max-height: 30px;
  cursor: default;
}

.toolbar .edited {
  color: #8e8e8e 
}

.toolbar .btns {
  margin-left: auto;
}
.toolbar .btns > * {
  display: inline-block;
}

.toolbar button {
  -webkit-app-region: no-drag;
  cursor: default;
  height: 25px;
  background: -webkit-linear-gradient(top, #fefefe, #f2f2f2);
  color: #565656;
  border: 1px solid;
  border-radius: 5px;
  border-top-color:    #c8c8c8;
  border-bottom-color: #acacac;
  border-left-color:   #c2c2c2;
  border-right-color:  #c2c2c2;
  box-shadow: 0 1px rgba(0, 0, 0, .039);
  font-size: 13px;
  line-height: 19px;
  margin-right: 5px;
}
.toolbar button:active,
.toolbar button.active {
  background: -webkit-linear-gradient(top, #e4e4e4, #dcdcdc);
}

.toolbar button img {
  height: 20px;
}

.toolbar .btngroup button:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}
.toolbar .btngroup button:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: 0;
}
